<template>
    <div>
        <h1>基于vue3的各种实例</h1>
        <el-button @click="onClick">vuex持久化插件</el-button>
        <p>vuex状态：{{ store.state.count }}</p>
    </div>
</template>

<script setup>
import { useStore } from 'vuex'

const store = useStore()
const onClick = () => {
    const num = store.state.count;
    store.commit('setCount', num + 1)
}
</script>

<style lang='less' scoped>
h1 {
    text-align: center;
    color: var(--red-500);
}

.content {
    height: 300px;
}
</style>